﻿Imports System.Data
Imports System.Data.SqlClient
Imports Entidad

Public Class AlertaDocumentoDatos

    Sub registrarAlerta(ByVal codDocumento As String, ByVal tdoc As String, ByVal emisor As String, ByVal descripcion As String)
        Dim conex As New Conexion
        Dim coneccion As SqlConnection = conex.conectar()
        coneccion.Open()
        Dim query As String = "INSERT INTO Documento_Cliente_Alerta(DCA_CIA,DCA_SUC,DCA_TipoDoc,DCA_CodDocumento,DCA_UsuarioEnv,DCA_UsuarioRec,DCA_FecIngreso,DCA_FecLectura,DCA_Descripcion) " &
                              "VALUES('01','01',@tipodoc,@dcadocum,@dcausuario,null,getDate(),null,@descrip)"
        Dim comando As New SqlCommand
        With comando
            .Connection = coneccion
            .CommandText = query
            .Parameters.AddWithValue("@tipodoc", tdoc)
            .Parameters.AddWithValue("@dcadocum", codDocumento)
            .Parameters.AddWithValue("@dcausuario", emisor)
            .Parameters.AddWithValue("@descrip", descripcion)
            .ExecuteNonQuery()
        End With
        coneccion.Close()
    End Sub

End Class
